home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0177_Tseng ET4000 SVGA Modes.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  1KB  |  73 lines

  1. {
  2. > I have one little question: how do I program my ET4000
  3. > graphics card in SVGA modes??? Without using some sort of
  4. > BGI or unit!
  5. }
  6. program tsenglabs_et4000_640x480x256_mode;
  7. { Direct screen writing in SuperVGA mode 640x480x256 on a TsengLabs ET4000 }
  8. { By Bas van Gaalen, Holland, PD }
  9. uses crt;
  10. var x,y:word; i,page:byte;
  11.  
  12. procedure setvideo(md:word); assembler;
  13. { 02dh - 630x350
  14.   02eh - 640x480
  15.   02fh - 640x400 }
  16. asm
  17.   mov ax,md
  18.   int 10h
  19. end;
  20.  
  21. procedure setpal(col,r,g,b : byte); assembler;
  22. asm
  23.   mov dx,03c8h
  24.   mov al,col
  25.   out dx,al
  26.   inc dx
  27.   mov al,r
  28.   out dx,al
  29.   mov al,g
  30.   out dx,al
  31.   mov al,b
  32.   out dx,al
  33. end;
  34.  
  35. procedure writescreen; assembler;
  36. asm
  37.   mov es,sega000
  38.   mov x,0
  39.   mov y,0
  40.  @l1:
  41.   mov ax,y
  42.   mov dx,640
  43.   mul dx
  44.   add ax,x
  45.   adc dx,0
  46.   mov di,ax
  47.   cmp dl,page
  48.   je @skip
  49.   mov page,dl
  50.   mov al,dl
  51.   mov dx,03cdh
  52.   out dx,al
  53.  @skip:
  54.   mov ax,x
  55.   add ax,y
  56.   mov [es:di],al
  57.   inc y
  58.   cmp y,480
  59.   jne @l1
  60.   mov y,0
  61.   inc x
  62.   cmp x,640
  63.   jne @l1
  64. end;
  65.  
  66. begin
  67.   setvideo($2e);
  68.   for i:=1 to 255 do setpal(i,255-i div 4,255-i div 4,30);
  69.   writescreen;
  70.   repeat until keypressed;
  71.   textmode(lastmode);
  72. end.
  73.